﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAL;
using BLL.Util;

namespace BLL
{
    public class BankbookBLL
    {
        internal static List<BankBook> GetAllBankBook(int aid)
        {
            BankBookDAL dal = new BankBookDAL();
            return dal.GetListByAID(aid);
        }
        /// <summary>
        /// 添加存折
        /// </summary>
        /// <param name="bb"></param>
        /// <returns></returns>
        public static bool AddBankBook(BankBook bb)
        {
            BankBookDAL dal = new BankBookDAL();
            if (dal.Insert(bb))
            {
                var list = CacheHelper.GetMyAllBankBook(bb.AID);
                list.Add(bb);
                return true;
            }            
            return false;
        }
    }
}
